package com.guizi.halftimesroom.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.guizi.halftimesroom.R;
import com.guizi.halftimesroom.bean.RecommandListNormanlBean;
import com.squareup.picasso.Picasso;

/**
 * Created by Alan on 2016/7/20.
 */
public class selectedNormalView extends LinearLayout {
    private Context mContext;
    private ImageView iv_seleced1, iv_seleced2;
    private TextView tv_seleced1, tv_seleced2;

    public selectedNormalView(Context context) {
        this(context, null);
    }

    public selectedNormalView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public selectedNormalView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    private void initView(Context context) {
        this.mContext = context;
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_selected_image, this);
        iv_seleced1 = (ImageView) view.findViewById(R.id.iv_seleced1);
        iv_seleced2 = (ImageView) view.findViewById(R.id.iv_seleced2);
        tv_seleced1 = (TextView) view.findViewById(R.id.tv_seleced1);
        tv_seleced2 = (TextView) view.findViewById(R.id.tv_seleced2);
    }
    public void setData(RecommandListNormanlBean bean1,RecommandListNormanlBean bean2){
        Picasso.with(mContext).load(bean1.getCover()).into(iv_seleced1);
        Picasso.with(mContext).load(bean2.getCover()).into(iv_seleced2);
        tv_seleced1.setText(bean1.getContent());
        tv_seleced2.setText(bean2.getContent());
    }
}
